﻿Imports System.Windows.Forms

<Serializable()> Public Class NormalLineTool
    Inherits BaseTool




    Dim m_Handler As Integer
    Dim tx, ty As Double

    Dim nx, ny As Double

    Dim mDown As Boolean = False

    Public mx, my As Double




    Public Overrides Sub mouseDown(ByVal sender As Object, ByVal e As AxMapWinGIS._DMapEvents_MouseDownEvent)

        If e.button = 1 Then



            If Me.OperShapeProperty Is Nothing Then '第一次绘制





                Me.OperShapeProperty = ShapeFactory.getNewLineShape()


                Me.OperShapeProperty.P1Property = Me.DownPointProperty
                Me.OperShapeProperty.plist.Add(Me.DownPointProperty)




            Else



                Me.OperShapeProperty.plist.Add(Me.DownPointProperty)

                InvokeEndDrawing()
                Me.OperShapeProperty = Nothing


            End If


        End If



    End Sub

    Public Overrides Sub mouseDrag(ByVal sender As Object, ByVal e As AxMapWinGIS._DMapEvents_MouseMoveEvent)

    End Sub

    Public Overrides Sub mouseMove(ByVal sender As Object, ByVal e As AxMapWinGIS._DMapEvents_MouseMoveEvent)





        If Me.OperShapeProperty.plist.Count = 1 Then



            ControlPaint.DrawReversibleLine(getScreen(Me.OperShapeProperty.plist.Item(0)), getScreen(Me.OldmovepointProperty), lColor)

            ControlPaint.DrawReversibleLine(getScreen(Me.OperShapeProperty.plist.Item(0)), getScreen(Me.NewmovepointProperty), lColor)


        End If


    End Sub

    Public Overrides Sub mouseUp(ByVal sender As Object, ByVal e As AxMapWinGIS._DMapEvents_MouseUpEvent)

      


        'Me.OperShapeProperty.plist.Add(Me.DownPointProperty)
        ''对于直线来讲，这里的绘制已经结束





    End Sub

    Public Overrides Sub setself()

    End Sub

    Public Overrides Sub unSet()

    End Sub

    Public Overrides Sub mouseDblClick(ByVal sender As Object, ByVal e As System.EventArgs)

    End Sub
End Class
